package com.ddwl.common.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author wenbin
 * @Date 2020/9/17 10:39
 */
public interface ProtocolConfigEnum {


    @AllArgsConstructor
    @Getter
    enum typeEnum {
        SERVICE(0, "服务协议"),
        FORBID_GOODS(1, "禁售商品协议"),
        AUTH_SHOP(2, "授权店铺协议");

        private Integer type;
        private String desc;

        public static Integer getTypeCode(String desc) {
            for (ProtocolConfigEnum.typeEnum typeEnum : values()) {
                if (typeEnum.getDesc().equals(desc)) {
                    return typeEnum.getType();
                }
            }
            return null;
        }
    }

    @AllArgsConstructor
    @Getter
    enum statusEnum {
        SUCCESS((byte)1, "成功"),
        FAILURE((byte)0, "失败"),
        ;

        private Byte code;
        private String desc;
    }

}
